package com.alibaba.middleware.hsf.lmbip;

import com.alibaba.lmbip.Lmbip;
import com.alibaba.middleware.hsf.Data;
import com.alibaba.middleware.hsf.guide.api.model.OrderModel;

import java.io.IOException;

/**
 * @author weipeng2k 2017年12月27日 上午11:00:20
 */
public class Serial {

    public static void main(String[] args) throws IOException {
        Lmbip lmbip = new Lmbip();

        for (int i = 0; i < 10; i++) {
            byte[] serialize = lmbip.serialize(Data.gen());

            System.out.println(serialize.length);
            try {
                OrderModel orderModel = (OrderModel) lmbip.deserialize(serialize);
                System.out.println(orderModel);
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            }

        }
    }

}
